﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Crevice2D.Core.Data
{
    public abstract class BaseObject
    {
        public Vector2 Position;
        public Vector2 Origin;
        public float Rotation;

        protected Texture2D _texture;
        protected string _texturePath;

        public int Width { get { return _texture.Width; } }
        public int Height { get { return _texture.Height; } }

        public Matrix Transformation
        {
            get
            {
                return Matrix.CreateTranslation(new Vector3(-Origin, 0.0f)) *
                    Matrix.CreateRotationZ(Rotation) * Matrix.CreateTranslation(new Vector3(Position, 0.0f));
            }
        }


        protected BaseObject() { }

        public virtual bool LoadContent() { return true; }

        public virtual void Update(GameTime gameTime) { }

        public virtual void Draw(GameTime gameTime) { }
    }
}
